<?php

class lawyermodel extends Model {

    public function __construct() {
        parent::Model();
    }


    public function find($id) {
        $this->db->where(array('id' => $id, 'type' => 1));
        $this->db->limit(1);
        $query = $this->db->get('lawyer');
        return $query->num_rows() > 0 ? $query->row() : false;
    }

    public function l_count() {
        $this->db->where('type',1);
        return $this->db->get('lawyer')->num_rows();
    }

    public function l_list($limit=null, $offset=null) {
        $this->db->where('type',1);
        if($limit){
            $this->db->limit($limit, $offset);
        }
        return $this->db->get('lawyer')->result();
    }

}